package com.kx.smartdevice.controller;

import com.kx.smartdevice.dto.R;
import com.kx.smartdevice.pojo.Menu;
import com.kx.smartdevice.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName UserController
 * @Author Sun
 * @Date 2021/5/26 9:57
 */

@RestController
@RequestMapping("/menus")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/menus")
    public R getAllMenus() {
        //获取所有的菜单
       List<Menu> menuList =  menuService.getAllMenus();
        return R.setOK(menuList);
    }
}
